Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development


Setting up structured nodes

A structured node is a node where each new level is created recursively from the same SDO. This means that you can expand a node any number of times, and you do not have to set up individual nodes for each level in the tree.

This section explains the process of setting up a node for a structured table using the gsm_node table, illustrated in Figure 9–5, from the Repository database (ICFDB) as an example.

Figure 9–5: Repository gsm_node table

As you can see from this diagram, the gsm_node table is linked to itself and is using the parent_node_obj and node_obj fields.

You can define a single node record to identify a node to expand indefinitely depending on its data. To do this, you create a node record that indicates that the SDO can expand into child nodes. To illustrate, create a node in the Tree Node Control window using the values shown in Figure 9–6. Note the information in the Structure tab as shown:

Figure 9–6: Tree Node Control window

The Structured node check box is enabled and identifies this node as a structured table node and allows related child nodes to be created.

When specifying values for a structured node, you must specify the following values in the following order:·

For example, if you want to list only those nodes that do not have a parent (that is, nodes that are the highest nodes in the structure), the root node would filter only on records where the parent_node_obj = 0. Since a node only has a value in the parent_node_obj field if it is a child of another node, you can specify the parent_node_obj as the parent key field. A child node is linked to its parent by checking that the parent’s key field value (node_obj) is equal to the parent_node_obj field for any other nodes. This makes the node_obj field the table’s child key field. Where both of these key fields have a data type of DECIMAL, the fourth value would be DECIMAL. Thus, the Fields To Store value would be:

0^parent_node_obj^node_obj^DECIMAL 

Once you have set up all the other standard information, you can create a dynamic TreeView in the normal way by creating a record in the Dynamic TreeView Builder.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095